package cn.Observer3;

/**
 * Created by jt on 2018/3/22.
 */
public class Student implements Observer {
    private Observable observable ;
    private String name ;

    public Student(String name,Observable observable){
        this.name = name ;
        this.observable = observable ;
        this.observable.addObserver(this) ;
    }

    @Override
    public void uodate(String msg) {
        System.out.println(name + "" + msg);
    }
}
